<?php

namespace app\common\model;
use think\Db;
/**
 * [导航图表]
 * @author [C。]
 * @return html
 */
class Banner extends Base
{
    protected $name = 'banner';
    /**
     * 根据搜索条件获取列表信息
     */
    public function getlist($map,$from = 0, $size = 5)
    {
        $order = ['sort' => 'asc','id' => 'desc'];
        $result =  $this->order($order)->limit($from, $size)->where($map)->select();
        return $result;
    }
    /**
     * 根据搜索条件获取总条数
     */
    public function getCount($map)
    {
        $result =  $this->where($map)->count();
        return $result;
    }
    /**
     * 获取相应字段列表信息
     */
    public function getListByFields($map,$field='*')
    {
        $order = ['sort' => 'asc','id' => 'desc'];
        $result =  $this->field($field)->where($map)->order($order)->select();
        return $result;
    }
}